package com.study.mqtt.controller;

import com.study.mqtt.config.MqttPushClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private MqttPushClient mqttPushClient;

    @GetMapping("/test")
    public String test(){
        mqttPushClient.pushlish("topic/name", "I am wuyu");
        return "发布成功";
    }
}
